package com.attilax.uti.global;

//r44 import java.util.Optional;

import com.attilax.io.pathx;
import com.attilax.util.PropX;


/**
 * com.attilax.uti.global.GlobalService
 * @author Administrator
 *
 */
public class GlobalService {

	public static void main(String[] args) {
		 String idx = getIndex();
		 try {
			 System.out.println( idx);
		} catch (Exception e) {
			e.printStackTrace();
		}
		

	}

	public static String getIndex() {
		String apptype=System.getProperty("apptype");
		 String cfg=pathx.webAppPath_jensyegeor()+"/"+apptype+".cfg.txt";
		 PropX px=new PropX(cfg);
		 String idx = px.getProperty("index");
	//	 Optional<String>  op=
		 if(idx==null)
			 idx="/";
		return idx;
	}
	
	
	public static String getCfgVal(String string) {
		String x = "resin.server："+ System.getProperty("resin.server");
		System.out.println(x);
		 String apptype=System.getProperty("apptype");
		 String cfgpath=pathx.webAppPath()+"/"+apptype+".cfg.txt";
		 PropX px=new PropX(cfgpath);
		return px.getProperty(string);
	}

}
